import request from '@/utils/request'
// 引入数据类型
import type {categoryResponesData} from './model/attr'
enum API{
   C1='/admin/product/getCategory1',
   C2='/admin/product/getCategory2/',
   C3='/admin/product/getCategory3/',
   ATTR='/admin/product/attrInfoList/',
   ADDORUPDATAATTR='/admin/product/saveAttrInfo',
   DELETE='/admin/product/deleteAttr/'
}
export const reqC1List=()=>request.get<any,categoryResponesData>(API.C1)
export const reqC2List=(category1Id:number|string)=>request.get<any,categoryResponesData>(API.C2+`${category1Id}`)
export const reqC3List=(category2Id:number|string)=>request.get<any,categoryResponesData>(API.C3+`${category2Id}`)
export const reqAttrList=(category1Id:number|string,category2Id:number|string,category3Id:number|string)=>request.get(API.ATTR+`${category1Id}/${category2Id}/${category3Id}`)
export const reqAddorUpdatartte=(data:any)=>request.post(API.ADDORUPDATAATTR,data)
export const reqDeleteAttr=(attrId:number|string)=>request.delete<any,any>(API.DELETE+`${attrId}`)